// Copyright (c) Microsoft Corporation.  All rights reserved.

#pragma once

using namespace System;
using namespace System::Collections;
using namespace System::ComponentModel;

namespace Microsoft { namespace Samples { namespace SqlServer { namespace SSIS { namespace EventLogSource {
	ref class EventEnumerator;

	// TODO make internal
	public ref class EventFile : IEnumerable {
	private:
		EventEnumerator^ enumerator;
		UInt32 recordCount;
		String^ fileName;
		String^ sourceName;
		String^ machineName;
		EventFile() {};
		void Initialize(String^ machineName, String^ fileName, String^ sourceName);

	internal:
		property HANDLE LogHandle;

	public:
		EventFile(String^ fileName, String^ sourceName);
		EventFile(String^ machineName, String^ fileName, String^ sourceName);
		~EventFile() { this->!EventFile(); } // destructor
		!EventFile(); // finalizer
		virtual IEnumerator^ GetEnumerator();
		UInt32 GetOldestRecordID();
		UInt32 GetNewestRecordID();
		UInt32 GetRecordCount();
		property String^ MachineName { String^ get(); }
		property String^ SourceName { String^ get(); }
		property String^ FileName { String^ get(); }
	};
} } } } }